//
//  ComposeTextView.swift
//  WBTest
//
//  Created by 张海峰 on 2017/8/1.
//  Copyright © 2017年 张海峰. All rights reserved.
//

import UIKit

class ComposeTextView: UITextView {
    
    
    //懒加载
    lazy var placeHolderLabel : UILabel = UILabel()
    //构造函数
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupUI()
    }
    
}
//设置UI界面
extension ComposeTextView{
    func setupUI() {
        
        //添加子控件
        addSubview(placeHolderLabel)
        
        //设置frame
        placeHolderLabel.snp.makeConstraints { (make) in
            make.top.equalTo(8)
            make.left.equalTo(10)
        }
        placeHolderLabel.textColor = UIColor.lightGray
        placeHolderLabel.font = font
        placeHolderLabel.text = "分享新鲜事"
        //设置内容的内边距
        textContainerInset = UIEdgeInsets(top: 8, left: 8, bottom: 0, right: 8)
    }
    
}
